package chances.declare.util;

import java.util.HashMap;
import java.util.Map;

public class JsonBody {
	final public static int RESULT_SUCCESS = 0;
    final public static int RESULT_FAILED = 1;
    final public static int RESULT_DUPLICATE = 2;
    final public static int RESULT_BLACK_LIST = 3;

	private int result;
	private String message;
	private Object data;
	private PageUtil page;
	private Map<String,Object> _links = new HashMap<String,Object>();

	public JsonBody() {
		this.result = RESULT_SUCCESS;
		this.message = "";
	}

	public PageUtil getPage() {
		return page;
	}

	public void setPage(PageUtil page) {
		this.page = page;
	}

	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

    public void setErrorResult(String message) {
        this.result = RESULT_FAILED;
        this.message = message;
    }
    
    public void setDuplicateResult(String message) {
        this.result = RESULT_DUPLICATE;
        this.message = message;
    }
    
    public void setBlackListResult(String message) {
        this.result = RESULT_BLACK_LIST;
        this.message = message;
    }

	public Map<String, Object> get_links() {
		return _links;
	}

	public void set_links(Map<String, Object> _links) {
		this._links = _links;
	}
    
}
